﻿using System;
using System.Web.UI;
using Cms.Utilities;
using Cms.Web.Framework.Plugins.Attributes;

namespace Cms.Web.Framework.Plugins
{
    public class HtmlBlock : BasePlugin
    {
        private string _html;

        [MultiRow(300), Code]
        public string Html
        {
            get { return _html; }
            set { _html = value; }
        }
        
        protected override void Render(HtmlTextWriter writer)
        {
            try
            {
                writer.Write(_html);
            }
            catch (Exception ex)
            {
                Logging.LogError("HtmlBlock", ex);
                Controls.Clear();
            }
        }
    }
}